<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>高速公路设备管理系统</title>
<link rel="shortcut icon" href="../images/yc1.ico" type="images/x-icon">
<link rel="stylesheet" type="text/css" href="../easyui/css/easyui.css">
<link rel="stylesheet" type="text/css" href="../easyui/css/icon.css">
<link rel="stylesheet" type="text/css" href="../easyui/css/demo.css">
<link rel="stylesheet" type="text/css" href="../css/index.css">
<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../easyui/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../easyui/js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../easyui/js/index.js"></script>
<script type="text/javascript" src="../js/back_index_time.js"></script>
<!-- 调用百度API -->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=CZAI60Hn99nYeUlU6VmW7TDGi1HQF4qf"></script>
<script type="text/javascript">
	function update(){
		$("#update_pwd").dialog("open");
	}
	
	function updatePwd(){
		var newPwd=$("#newPwd").val();
		var pwd=$("#newPwd_1").val();
		if(newPwd=="" || pwd==""){
			$.messager.alert('错误提示','请输入完整的数据!','error');
			return;
		}
		if(newPwd!=pwd){
			$.messager.alert('错误提示','两次密码不一致,请重新输入!','error');
			return;
		}else{
			var currentLogin=$(".back_current_user").text();
			if(currentLogin=="管理员"){
				currentLogin="../login/updateAdminPwd";
			}else{
				currentLogin="../login/updateStaffPwd";
			}
			$.ajax({
			    url: currentLogin,    //请求的url地址
			    dataType: "json",   //返回格式为json
			    async: true, //请求是否异步，默认为异步，这也是ajax重要特性
			    type: "POST", 
			    data: { "pwd": pwd},    //参数值
			    success: function(data) {
			    	if(parseInt($.trim(data))>=1){
			    		$("#update_pwd").dialog("close");
			    		$.messager.confirm("成功提示", "密码修改成功,请重新登录！", function (r) {  
			    	        if (r) {  
			    	        	location="../login.html";
			    	        }
			    	    });  
			    	}else{
			    		$.messager.alert('错误提示','网络错误,请稍后重试!','error');
			    	}
			    },
			});
		}
	}
</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'north',border:false" style="height:80px; background:#fff ;padding:10px;">
		<div class="back_head">
			<div class="back_header_left">
				<p>高速公路设备管理系统</p>
			</div>
			<div class="back_header_right">
				<p>
					你好!&nbsp;[&nbsp;<span class="back_current_user">管理员</span> :
					<c:if test="${!empty sessionScope.adminInfo.adminId}">
						${sessionScope.adminInfo.adminId}&nbsp;]
					</c:if>
					<c:if test="${!empty sessionScope.staffInfo.mid}">
						${sessionScope.staffInfo.mid}&nbsp;]
					</c:if>
					&nbsp;&nbsp;&nbsp;&nbsp;<a class="back_exit" href="javascript:exit();">退出系统</a>
				</p>
				<a href="javascript:update()" style="text-decoration: none;">修改密码</a>
				<br>
				<p id="back_curent_time">2000年1月1日  00:00:00  星期一</p>
				<br/>
				
			</div>
		</div>
	</div>
	<div id="update_pwd" class="easyui-dialog" title="修改密码" style="width:400px;height:180px;"
	data-options="iconCls:'icon-add',resizable:true,modal:true,closed:true">
		<p style="width:100%;text-align:center;">
			<br>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>新密码:</label><input type="password" id="newPwd" maxlength="6"/>
			<br><br>
			<label>请再输入一次:</label><input type="password" id="newPwd_1" maxlength="6"/>
			<br><br>
			<input type="button" value="修改" onclick="updatePwd()" style="width:100px;height:30px;"/>
		</p>
	</div>
	<div data-options="region:'west',split:true,title:'导航'" style="width:160px;pading:10px;">
		<ul id="menu_tree" class="easyui-tree">
			<li id="admin"><span>菜单</span>
				<ul>
					<li id="admin_sys_Manage">系统管理</li>
					<li id="admin_equ_Info">设备信息管理</li>
					<li id="admin_main_Staff">维护人员管理</li>
					<li id="admin_main_Approve">维护审批管理</li>
					<li id="admin_rou_Inspection">常规巡检管理</li>
				</ul>
			</li>
			<li id="staff"><span>菜单</span>
				<ul>
					<li id="staff_sys_Manage">维护申请</li>
					<li id="staff_see_Inspection">常规巡检</li>
				</ul>
			</li>
		</ul>
	</div>
	<div data-options="region:'south',border:false" style="height:40px;background:#fff;padding:0px;">
		<p style="text-align:center;font-size:16px;margin-top:10px;font-family:cursive;">Copyright &copy; 湖南工学院计信学院  版权所有</p>
	</div>
	<div
		data-options="region:'center',title:'内容',tools:[{
			iconCls:'icon-full',
			handler:function(){full();}
		},{
			iconCls:'icon-unfull',
			handler:function(){unfull();}
		}]">
		<div id="center_content" class="easyui-tabs" data-options="fit:true">

		</div>
	</div>
</body>
</html>

